<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Scrolls:  Line Scroller</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT = "no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="Ernst Straka (ernst.straka@central-europe.basf.org)">
<META NAME="section" CONTENT="Scrolls">
<META NAME="description" CONTENT="An impressive single line news ticker with smooth scrolling motion.  Supports any valid HTML within the scroll text, including images or links.  Really easy to position on your page, just place the 'tickpos' anchor where you want the scroller to appear.  Easy!">

<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Original:  Ernst Straka (ernst.straka@central-europe.basf.org) -->
<!-- Web Site:  http://www.rs-systems.at/straka -->




<!-- Begin
var l1 =   0; // left of ticker in pixel, or 0 to position relative
var t1 =   0; // top of ticker in pixel, or 0 to position relative
var w1 = 475; // width of ticker in pixel
var ie = document.all ? true : false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;
function tickinit() {
if (ie) {
if (l1 == 0 && t1 == 0) {
pos = document.all['tickpos'];
l1 = getLeft(pos);
t1 = getTop(pos);
}
ticktext.style.posTop = t1;
}
else {
if (l1 == 0 && t1 == 0) {
pos = document.anchors['tickpos'];
l1 = pos.x;
t1 = pos.y;
}
document.ticktext.pageY = t1;
}
l2 = l1 + w1;
l3 = l1 - l2;
l = l2;
setInterval('tick()', 10);
}
function getLeft(ll) {
if (ll.offsetParent)
return (ll.offsetLeft + getLeft(ll.offsetParent));
else 
return (ll.offsetLeft);
}
function getTop(ll) {
if (ll.offsetParent)
return (ll.offsetTop + getTop(ll.offsetParent));
else
return (ll.offsetTop);
}
function tick() {
l = l - 0.5;
if (l < l3) l = l2;
cl = l1 - l;
cr = l2 - l;
if (ie) {
ticktext.style.posLeft = l;
ticktext.style.posTop = t1;
ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
if (first) ticktext.style.visibility = "visible";
}
else {
document.ticktext.pageX = l;
document.ticktext.clip.left = cl;
document.ticktext.clip.right = cr;
if (first) document.ticktext.visibility = "show";
}
first = false;
}
//  End -->
</script>
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff OnLoad="tickinit()">

<BR>
<center>
<table width=600 cellpadding=0 cellspacing=10>
<tr>
<td width=468 align=center>

    
    
</td>
<td width=120 align=center>
    
</td>
</tr>
</table>
<BR>
<BR>
<basefont size=3>
<FONT SIZE="+2" FACE="Helvetica,Arial">
<A HREF="../index.htm" /" TARGET="_top"><FONT COLOR="#0000FF"><b>Home</b></font></A>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}">
<A HREF="index.htm" /scrolls/"><font color="#FF0000"><b>Scrolls</b></font></A>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}">
<FONT COLOR="#006666"><b>Line Scroller</b></font></font>
<BR>
<BR>
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE="helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->
An impressive single line news ticker with smooth scrolling motion.  Supports any valid HTML within the scroll text, including images or links.  Really easy to position on your page, just place the 'tickpos' anchor where you want the scroller to appear.  Easy!
<hr>
<p>
<a name="tickpos">&nbsp;</a>

<div id="ticktext" style="position:absolute;font-family:arial;font-size:14pt;visibility:hidden;">
<nobr>Doesn't this message scroller look great?  You can even insert links like this: <a href="javascript:if(confirm('http://www.yahoo.com/  \n\nYou must be connected to the Internet to access this link.  \n\nDo you want to open it from the server?'))window.location='http://www.yahoo.com/'" tppabs="http://www.yahoo.com/" target="_blank">yahoo.com</a>  Now it repeats.</nobr>
</div>

</td></tr>
</table>
<!-- Demonstration -->
<P>
<P>
<a name="source">
<table BORDER=0 WIDTH=486 CELLPADDING=3 CELLSPACING=0>
<tr><td BGCOLOR=yellow><font FACE="helvetica,arial,geneva"><b>JavaScript Source Code 3000:  Scrolls:  Line Scroller</b>
<p>Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as Note Pad or Simple Text) and save (Control-s or Apple-s).  The script is yours!!!
<br><br></font></td></tr>
<tr><td BGCOLOR=yellow ALIGN=CENTER>
<form NAME="copy">

<DIV align="center">
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();">&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" NAME="total" VALUE="Script Size:  2.48 KB" size=24>
</DIV>

<textarea NAME="txt" ROWS=20 COLS=75 WRAP=VIRTUAL>

&lt;!-- THREE STEPS TO INSTALL LINE SCROLLER:

  1.  Copy the coding into the HEAD of your HTML document
  2.  Add the onLoad event handler into the BODY tag
  3.  Put the last coding into the BODY of your HTML document  --&gt;

&lt;!-- STEP ONE: Paste this code into the HEAD of your HTML document  --&gt;

&lt;HEAD&gt;

&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt;
&lt;!-- Original:  Ernst Straka (ernst.straka@central-europe.basf.org) --&gt;
&lt;!-- Web Site:  http://www.rs-systems.at/straka --&gt;

&lt;! &gt;
&lt;! &gt;

&lt;!-- Begin
var l1 =   0; // left of ticker in pixel, or 0 to position relative
var t1 =   0; // top of ticker in pixel, or 0 to position relative
var w1 = 400; // width of ticker in pixel
var ie = document.all ? true : false;
var first = true;
var l2 = l1 + w1;
var l3 = l1 - l2;
var l = l2;
function tickinit() {
if (ie) {
if (l1 == 0 && t1 == 0) {
pos = document.all['tickpos'];
l1 = getLeft(pos);
t1 = getTop(pos);
}
ticktext.style.posTop = t1;
}
else {
if (l1 == 0 && t1 == 0) {
pos = document.anchors['tickpos'];
l1 = pos.x;
t1 = pos.y;
}
document.ticktext.pageY = t1;
}
l2 = l1 + w1;
l3 = l1 - l2;
l = l2;
setInterval('tick()', 10);
}
function getLeft(ll) {
if (ll.offsetParent)
return (ll.offsetLeft + getLeft(ll.offsetParent));
else 
return (ll.offsetLeft);
}
function getTop(ll) {
if (ll.offsetParent)
return (ll.offsetTop + getTop(ll.offsetParent));
else
return (ll.offsetTop);
}
function tick() {
l = l - 0.5;
if (l &lt; l3) l = l2;
cl = l1 - l;
cr = l2 - l;
if (ie) {
ticktext.style.posLeft = l;
ticktext.style.posTop = t1;
ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
if (first) ticktext.style.visibility = "visible";
}
else {
document.ticktext.pageX = l;
document.ticktext.clip.left = cl;
document.ticktext.clip.right = cr;
if (first) document.ticktext.visibility = "show";
}
first = false;
}
//  End --&gt;
&lt;/script&gt;
&lt;/HEAD&gt;

&lt;!-- STEP TWO: Insert the onLoad event handler into your BODY tag  --&gt;

&lt;BODY OnLoad="tickinit()"&gt;

&lt;!-- STEP THREE: Copy this code into the BODY of your HTML document  --&gt;

&lt;a name="tickpos"&gt;&nbsp;&lt;/a&gt;

&lt;div id="ticktext" style="position:absolute;font-family:arial;font-size:14pt;visibility:hidden;"&gt;
&lt;nobr&gt;Doesn't this message scroller look great?  You can even insert links like this: &lt;a href="http://www.yahoo.com" target="_blank"&gt;yahoo.com&lt;/a&gt;  Now it repeats.&lt;/nobr&gt;
&lt;/div&gt;

 

&lt;!-- Script Size:  2.48 KB --&gt;</textarea><br><font FACE="helvetica,arial,geneva"></font></td></tr>

</table>
</form>
</FONT>
</CENTER>


</center>
</body></html>
